#include<reg52.h>
sbit UD = P2^6;
sbit WE = P2^7;
void delay(unsigned int n);
void oi(long int i);
void main()
{

long int i = 0;

while(1)
{
oi(i);
i++;
}
}
void oi(long int i)
{
int a[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f};
int b[10]={0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef};
long int x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5;
int j = 0;
x1 = i/100000;
y1 = i%100000;
x2 = y1/10000;
y2 = y1%10000;
x3 = y2/1000;
y3 = y2%1000;
x4 = y3/100;
y4 = y3%100;
x5 = y4/10;
y5 = y4%10;
x6 = y5;
while(j < 200){


UD = 1;
P0 = a[x1];
UD = 0;
P0 = 0xff;
WE = 1;
P0 = 0xfe;
WE = 0;
delay(1);

UD = 1;
P0 = a[x2];
UD = 0;
P0 = 0xff;
WE = 1;
P0 = 0xfd;
WE = 0;
delay(1);

UD = 1;
P0 = a[x3];
UD = 0;
P0 = 0xff;
WE = 1;
P0 = 0xfb;
WE = 0;
delay(1);

UD = 1;
P0 = a[x4];
UD = 0;
P0 = 0xff;
WE = 1;
P0 = 0xf7;
WE = 0;
delay(1);

UD = 1;
P0 = b[x5];
UD = 0;
P0 = 0xff;
WE = 1;
P0 = 0xef;
WE = 0;
delay(1);

UD = 1;
P0 = a[x6];
UD = 0;
P0 = 0xff;
WE = 1;
P0 = 0xdf;
WE = 0;
delay(2);
j++;
}

}
void delay(unsigned int n)
{
    unsigned int i,j;
    for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {

        }
    }
}